This section describes how working with the Frontier Menubar Editor differs from working with ordinary Frontier outlines.The use of and navigation in a menubar editor is identical to that of any other outline. The differences you should note about the menubar editor are:
- A sub-heading is actually a nested sub-menu. The Macintosh human interface guidelines recommend only one level of sub-menu, though of course you may use deeper levels if you prefer. (The Macintosh system software will not permit you to nest menus deeper than five levels.)
- If you type a single hyphen as the entry in a heading, Frontier expands that to a full menu separator.
- You can examine the script connected to a menu item by selecting it or positioning your cursor in it and then clicking on the Script button.
- You can see which Command-key equivalents have been set for this menu and set up your own from the Cmd: popup menu in the lower left of the window.
As with menubar-editing windows, script editors operate nearly identically to other outline windows in Frontier, with a few extra issues to consider:When you have entered a script into a script-editing window and you wish to run it from there, you can do so just by clicking on the Run button.
- To insert a comment line as you type in a UserTalk script, press Return while you hold down the Shift key. (In fact, this shortcut works in a normal outline too.)
- Toggling comments with the menu or keyboard equivalent can change the nature of headings embedded under the heading whose type you change. (See Chapter 3.)
- Command-clicking on an item marker toggles a breakpoint on that line.
If you want to debug your program -- whether that means simply tracing through its execution to understand it better or looking for an error of some sort -- you can click on the Debug button in the script execution window. That will display debugging options (see Figure 7-44). Debugging is described in Chapter 3.
Figure 7-44. Debugging Options in Script Window
The Quick Script window provides a place for you to enter short scripts (usually just one line) and execute them immediately. Just type the text and pres the Enter key or click the Run button. For multi-line scripts, you may it easier to use a normal script window where Frontier's outliner captures the structure of the script. If you do type a multi-line script into Quick Script, you must include extra syntax to indicate the structure:Contents Page | Previous Section | Next Chapter -- Scripting the Operating SystemFigure 7-42 shows a small sample script as entered in a script editing window. Figure 7-43 shows the same script as it would be formatted in the Quick Script window.
- Wherever you would normally place a carriage return in a script (i.e., when starting a new line or heading), you must use a semicolon in the Quick Script window.
- Wherever you would use a Tab key to indent one or more lines of code in a script, you must use curly braces in the Quick Script window around the lines that would be indented in a script outline. In this case, you must not add a semicolon to the preceding line.
Figure 7-42. Sample Script in Script-Editing Window
Figure 7-43. Sample Script in Quick Script Window